Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@stylable/runtime
Advanced tools
@stylable/runtime
provides the utility that is used to create the stylesheet functions that apply classNames
and states
to the DOM. It also exposes an optional DOM renderer that is responsible for loading CSS in its correct order.
End-users will usually not add this package directly as a dependency themselves, and would instead receive it as a dependency of their chosen integration (e.g. @stylable/webpack-plugin
).
@stylable/runtime
exposes two methods, Stylesheet
and Renderer
.
The stylesheet function is returned when importing a Stylable stylesheet. It is used for creating the DOM-attributes required for CSS to be applied.
style(className: string, states?: StateMap, props: InheritedAttributes)
Argument | Type | Description | Required |
---|---|---|---|
className | string | className to be namespaced | true |
states | StateMap | object containing states and their values | false |
inheritedAttributes | InheritedAttributes | props passed to the root node from the parent component (automatically passing through className and data-* attributes) | false |
import style from './local.st.css';
props = {
className: "app1211903207--root",
"data-app1211903207-propstate": true
}
style('root');
// returns "{
// "className": "local1211372639--root"
// }"
style('root', {localState: true});
// returns "{
// "data-local1211372639-localstate": true,
// "className": "local1211372639--root"
// }"
style('root', {localState: true}, props);
// returns "{
// "data-local1211372639-localstate": true,
// "data-app1211903207-propstate": true,
// "className": "local1211372639--root app1211903207--root"
// }"
// The stylesheet function also exposes a map of classNames and their namespaced values.
style.root;
// returns "local1211372639--root"
Responsible for managing CSS files, linking to the document
and maintaining their correct order in your application.
Copyright (c) 2017 Wix.com Ltd. All Rights Reserved. Use of this source code is governed by a BSD license.
FAQs
Stylable runtime DOM integration
We found that @stylable/runtime demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.